package com.nx.vip.collection.rbt;

import java.util.Comparator;
import java.util.HashMap;
import java.util.TreeMap;

/**
 * java中实现对象的比较
 * 1、implements Comparable
 * 2、Comparator
 */
public class TreeMapTest {
    public static void main(String[] args) {
            TreeMap<String, String> treeMap = new TreeMap<>();
            treeMap.put("hello","world");
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("key","value");

        new TreeMap<>(new Comparator(){

            @Override
            public int compare(Object o1, Object o2) {
                return 0;
            }
        });
    }


}
class Node implements Comparable{


    @Override
    public int compareTo(Object o) {
        return 0;
    }
}
